//
//  MineViewCell.m
//  BaseAPP
//
//  Created by Evisu on 16/12/16.
//  Copyright © 2016年 evisum. All rights reserved.
//

#import "MineViewCell.h"

@implementation MineViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self initViews];
        [self layoutViews];
    }
    
    return self;
}

- (void)initViews {
    
    self.ivIcon = [[UIImageView alloc] init];
    
    self.labTitle = [[UILabel alloc] init];
    self.labTitle.font = [UIFont systemFontOfSize:16.0];
    self.labTitle.textColor = HEXColor(@"000000");
    
    self.ivArrow = [[UIImageView alloc] init];
    self.ivArrow.image = [UIImage imageNamed:@"arrow_ico"];
    
    self.vLine = [[UIView alloc] init];
    self.vLine.backgroundColor = KTABLEVIEW_SEPARATION_LINE;
    
    [self.contentView addSubview:self.ivIcon];
    [self.contentView addSubview:self.labTitle];
    [self.contentView addSubview:self.ivArrow];
    [self.contentView addSubview:self.vLine];
}


- (void)layoutViews {
    
    self.ivIcon.sd_layout
    .centerYEqualToView(self.contentView)
    .leftSpaceToView(self.contentView, 16)
    .widthIs(25)
    .heightIs(25);
    
    self.labTitle.sd_layout
    .centerYEqualToView(self.contentView)
    .leftSpaceToView(self.ivIcon, 18);
    [self.labTitle setSingleLineAutoResizeWithMaxWidth:80];
    
    self.ivArrow.sd_layout
    .centerYEqualToView(self.contentView)
    .rightSpaceToView(self.contentView, 16)
    .widthIs(8)
    .heightIs(15);
    
    self.vLine.sd_layout
    .bottomSpaceToView(self.contentView, 0)
    .leftEqualToView(self.ivIcon)
    .rightEqualToView(self.contentView)
    .heightIs(1);
}

@end
